namespace mplat {

    /** 初始化分享的数据 */
    export function initShareInfo(info: IShareInitData) {
        plat.openAbility.setShareInfo(info.shareList, info.defaultShareIdx, info.minTime, info.minCount);
        plat.openAbility.setShareDefaultData(info.shareDefData);
        plat.openAbility.setShareDefaultComplete(info.shareDefSuccess, info.shareDefFail, info.shareDefComplete);
        plat.openAbility.setShareFailTips(info.shareFailTips);
    }

    /** 主动分享 */
    export function shareAppMessage(param?: IShareInfo, data?: any, success?: () => void, fail?: () => void) {
        plat.openAbility.shareAppMessage(param, data, success, fail);
    }

    /** 初始化右上角的···的分享功能 */
    export function showShareMenu(withShareTicket = false) {
        plat.openAbility.showShareMenu(withShareTicket);
    }

    /** 跳转到其他的小游戏 */
    export function navigateToMiniProgram(param: INavigateParam) {
        plat.openAbility.navigateToMiniProgram(param);
    }

    /** 是否添加过桌面图标，ov有的特性 */
    export function hasShortcutInstalled(success?: (res) => void, fail?: (err) => void, complete?: () => void) {
        plat.openAbility.hasShortcutInstalled(success, fail, complete);
    }
    /** 添加桌面图标，ov的特性 */
    export function installShortcut(message?: string, success?: () => void, fail?: (err) => void, complete?: () => void) {
        plat.openAbility.installShortcut(message, success, fail, complete);
    }
    /** 添加桌面图标，vivo的特性 */
    export function isStartupByShortcut(success?: (res) => void, fail?: () => void) {
        plat.openAbility.isStartupByShortcut(success, fail);
    }
}